<?php if( ! defined('BASEPATH')) exit('No direct script acess allowed!');

class Util
{
	public static function mostraData($data)
	{
		if(strstr($data, " "))
		{
			$arr1 = explode(" ",$data);
			$arr2 = explode("-",$arr1[0]);
			$result = $arr2[2] . '/' . $arr2[1] . '/' . $arr2[0];
		}
		else
		{
			$arrData = explode("-",$data);
			$result = $arrData[2] . '/' . $arrData[1] . '/' .$arrData[0];
		}
		
		
		return $result;
	}

	public static function mostraDataHora($data)
	{
		$arr1 = explode(" ",$data);
		$arr2 = explode("-",$arr1[0]);
		$arr3 = explode(':',$arr1[1]);
		
		$result = $arr2[2] . '/' . $arr2[1] . '/' . $arr2[0] . ' ' . $arr3[0] . ':' .  $arr3[1];
	
		return $result;
	}
}

?>